namespace Commons
{
    using CustomControls;
    using WPFBPMN.Utils;

    public class Logic
    {

        public static bool CanBuildShape(BPMNShape bpmnshape, ShapeType shapeType, out string error)
        {
            error = "";
            if (Utils.BPMNLegalShapes.ContainsKey(bpmnshape.BPMNShapeType) && Utils.BPMNLegalShapes[bpmnshape.BPMNShapeType].Contains(shapeType))
            {
                return true;
            }
            else
            {
                error = "Can't build a " + shapeType.ToString().Substring(4) + " in a " + bpmnshape.BPMNShapeType.ToString().Substring(4);
                return false;
            }
        }
    }
}
